package com.wanmait.hotelManage.webservlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wanmait.hotelManage.dao.messageDAO;
import com.wanmait.hotelManage.servlet.NewsCommentReportServlet;
import com.wanmait.hotelManage.vo.NewsCommentReport;

/**
 * Servlet implementation class messageServlet
 */
@WebServlet("/messageServlet")
public class messageServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public messageServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String action=request.getParameter("action");
		if("message".equals(action)) {
			this.message(request, response);
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void message(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
     List<NewsCommentReport>nscr=(List<NewsCommentReport>) messageDAO.getDAO().getnewsCommentReports();
		request.setAttribute("nscr",nscr);
		request.getRequestDispatcher("FrontDesk/center/message.jsp").forward(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
